package com.zyh.fengzhuanghejichengzuoye.test4.domain;

public class Book {
    private String bName;
    private String author;
    private String company;
    private double price;

    //构造方法
    public Book() {
    }

    public Book(String bName, String author, String company, double price) {
        this.bName = bName;
        this.author = author;
        this.company = company;
        this.price = price;
    }

    //方法
    public void show(){
        System.out.println("书名："+getbName());
        System.out.println("作者："+getAuthor());
        System.out.println("出版社："+getCompany());
        System.out.println("价格："+getPrice());
    }

    //

    public String getbName() {
        return bName;
    }

    public void setbName(String bName) {
        this.bName = bName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        if (price<=10){
            System.out.println("错误！价格必须大于10！");
        }
        else {
            this.price = price;
        }
    }
}
